package Booking;

public class Book {
    private String bookName;  //书名
    private String author; //作者名
    private double price;  //书价
    private String type;  //书的种类
    boolean isBorrowed;   //借书状态
     //有参构造函数
    public Book(String bookName,String author,double price,String type)
     {
         this.bookName=bookName;
         this.author=author;
         this.price=price;
         this.type=type;
}

    public String getBookName() {
        return bookName;
    }

    public String getAuthor() {
        return author;
    }

    public double getPrice() {
        return price;
    }

    public String getType() {
        return type;
    }

    public boolean isBorrowed() {
        return isBorrowed;
    }


    //需要被改变的属性使用set

    public void setPrice(double price) {
        this.price = price;
    }

    public void setBorrowed(boolean borrowed) {
        isBorrowed = borrowed;
    }

    public void setType(String type) {
        this.type = type;
    }
    @Override
    public String toString() {
        return "Book{" +
                "bookName='" + bookName + '\'' +
                ", author='" + author + '\'' +
                ", price=" + price +
                ", type='" + type + '\'' +
                ", isBorrowed=" + isBorrowed +
                '}';
    }

}
